package com.yike.user.param;

import com.yike.common.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 用户表
 *
 * @author Sakura
 * @since 2023-08-14
 */
@Data
@Accessors(chain = true)
@ApiModel(value = "登录参数")
public class LoginParam implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "登录类型：1账号密码 2微信小程序授权 3短信验证码登录", required = true)
    private Integer loginType;

    @ApiModelProperty(value = "登录来源：1客户端 2商户端 3代理商端", required = true)
    private Integer loginSource;

    @ApiModelProperty(value = "用户名称 type为1必传", required = true)
    //@NotBlank(message = "用户名称不能为空")
    //@Pattern(regexp = "^$|^((13[0-9])|(15[^4])|(18[0-9])|(17[0-8])|(16[0-8])|(147))\\d{8}$", message = "手机号码格式错误")
    private String username;

    //@NotBlank(message = "设备号不能为空")
    @ApiModelProperty(value = "设备号", required = true)
    private String macNo;

    @ApiModelProperty(value = "getSalt()接口获取的saltKey值", required = true)
    //@NotBlank(message = "saltKey不能为空")
    private String saltKey;

    @ApiModelProperty(value = "密码 type为1必传", required = true)
    //@NotBlank(message = "密码不能为空，前端从getSalt()接口获取盐使用AES加密传输")
    private String password;

    @ApiModelProperty(value = "微信授权code type为2必传", required = true)
    private String authCode;

    @ApiModelProperty("手机号 type为3必传")
    @Pattern(regexp = "^$|^((13[0-9])|(15[^4])|(18[0-9])|(17[0-8])|(16[0-8])|(147))\\d{8}$", message = "手机号码格式错误")
    private String mobile;

    @ApiModelProperty("短信验证码 type为3必传")
    private String smsCode;

}
